home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dspgroup / mac320.arc / EMU.DOC < prev    next >
Encoding:
Text File  |  1986-04-10  |  14.6 KB  |  535 lines

  1.  
  2.  
  3.                            EMU Processor Emulator
  4.  
  5.  
  6.  
  7. EMU performs a software simulation  of  the  target  processor  to  enable  the
  8. verfication of program logic.    Software  emulation  cannot  replace  hardware
  9. emulation for testing aspects of your program which depend upon the  timing  of
  10. critical external events, or for interaction with real world devices. EMU  does
  11. provide symbolic debugging of the logic portions of your program, and may  thus
  12. prove convenient for testing those portions of your program  before  submitting
  13. the program to hardware for a full scale test.
  14.  
  15.  
  16.  
  17. Input to EMU consists of an object file .HEX produced by the  MACxx  assembler,
  18. and an optional .SYM file which can be produced at the time of assembly.    EMU
  19. looks for the .SYM file on the same disk drive as the hex  object  file.    The
  20. symbol file can be produced by following the assembly  option  immediately  (no
  21. space separating) with another drive specification:
  22.  
  23.  
  24. MACxx SOURCE.ABE        creates the hex file on drive B,reading the source
  25.                         file on drive A. No listing or SYM files are produced.
  26.  
  27. MACxx SOURCE.ABEB       creates a symbol file on drive B as well as the hex
  28.                         file.  The drive selected for the .SYM file should
  29.                         be the same as that selected for the object file if
  30.                         the symbol file is to be used by EMU.
  31.  
  32.  
  33.  
  34. EMU is menu driven: at various stages of its operation you can bring up a  menu
  35. and select from a suite of functions.    The  menu  items  are  generally  self
  36. explanatory however the following notes should augment the menu notes.
  37.  
  38.  
  39.  
  40. The main control menu consists of:
  41.  
  42.  
  43.         A       Assemble
  44.         B       Set Offset Bias
  45.         D       Display Memory
  46.         E       Enter Memory
  47.         F       Fill Memory
  48.         L       Load Program
  49.         M       Move Memory
  50.         Q       Quit
  51.         S       Search Memory
  52.         T       Display Symbol Table
  53.         U       Disassemble Memory
  54.         X       Emulation Monitor
  55.         =       Evaluate Expression
  56.  
  57.  
  58.  
  59.  
  60.  
  61. Response to the menu consists of one of the above  characters,  followed  by  a
  62. parameter list.  You may enter your response in either upper or lower case.  If
  63. a SYM file was accessed by program load, the parameter list can  contain  valid
  64. references to the symbol table.  An invalid expression  in  the  paramter  list
  65. voids the entire list.  Numeric parameters are default hex.   If  you  wish  to
  66. represent a decimal number it must be suffixed by  t  (for  ten).    Since  EMU
  67. allows symbolic references, which must  begin  with  an  alphabetic  character,
  68. numeric entries must begin with a digit.  Thus FF  represents  the  symbol  FF,
  69. which may not be found in the symbol table, and 0FF repesents the hex value.
  70.  
  71.  
  72.  
  73.  
  74.  
  75.                                L Load Program
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. Program loading is cumulative, in that the workspace area and symbol table  are
  83. not cleared before program load.  You may  therefore  load  individual  program
  84. segments separately.  If duplicate symbols exist in the separate load  segments
  85. the expression evaluator will find only the last definition.
  86.  
  87.  
  88.  
  89.  
  90.                                     QUIT
  91.  
  92.  
  93. At the outer menu level Q returns to the operating system.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.                                  A Assemble
  100.  
  101.  
  102. The in-line assembler option allows you to  enter  instructions  directly  into
  103. memory.  No symbols may be entered into the symbol table.  Symbolic  references
  104. are allowed only to those symbols learned from the .SYM file.  A line beginning
  105. with a blank returns control to the main menu.
  106.  
  107.  
  108.  
  109.  
  110.                               B Set Offset Bias
  111.  
  112.  
  113.  
  114.                               -2-
  115.  
  116.  
  117.  
  118.  
  119. The program space may be mapped into any address within  a  64k  space  by  the
  120. offset bias.  You must execute this command if your program is to  run  outside
  121. the region bounded by 0 and the available memory limit.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                               D Display Memory
  128.  
  129.  
  130.  
  131. The display command is entered as:
  132.  
  133.  
  134.         Dstart,end
  135.  
  136.  
  137. The end parameter is optional.  The display will exhibit 16 bytes of memory  if
  138. the end is ommitted.  The start and end may consist  of  any  valid  expression
  139. using program symbols.  The display will halt for key  press  after  15  lines.
  140. You may type ESCape to abort the display and return to the menu.
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.                                E Enter Memory
  149.  
  150.  
  151.  
  152. The enter memory command allows you to modify  the  workspace  program  memory.
  153. The command is entered as:
  154.  
  155.  
  156.         Estart
  157.  
  158.  
  159. The display will present the current memory address and the current contents at
  160. that address.  You may step over the  current  location  without  changing  its
  161. contents by entering only a carriage return.   Entering  an  8  bit  expression
  162. followed by a carriage return will store the value of  the  expression  at  the
  163. current address.  You may abort the sequence by typing a period followed  by  a
  164. carriage return.
  165.  
  166.  
  167.  
  168.  
  169.  
  170.                                 F Fill Memory
  171.  
  172.  
  173.  
  174. The memory fill command allows you to initialize a  portion  of  the  workspace
  175.  
  176.                               -3-
  177.  
  178.  
  179.  
  180.  
  181. area.  The command is entered as:
  182.  
  183.  
  184.         Fstart,end,value
  185.  
  186.  
  187. The region between start and end inclusive will be filled with the byte value.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                 M Move Memory
  195.  
  196.  
  197.  
  198. The Move command allows you to move a block  of  workspace  memory  to  another
  199. location.  The command format is:
  200.  
  201.  
  202.         Mstart,end,destination
  203.  
  204.  
  205.  
  206. The block of  memory  from  start  to  end  inclusive  will  be  moved  to  the
  207. destination location.
  208.  
  209.  
  210.  
  211.  
  212.  
  213.                                S Search Memory
  214.  
  215.  
  216.  
  217. The search function allows you to find a string of bytes in  workspace  memory.
  218. The command is entered as:
  219.  
  220.  
  221.         Sstart,end,v1,v2,v3,......
  222.  
  223.  
  224.  
  225. The search will display all  locations  within  the  interval  start-end  which
  226. contain the sequence v1,v2,v3.....  No such display implies that  the  sequence
  227. was not found.
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.                             U Disassemble Memory
  235.  
  236.  
  237.  
  238.                               -4-
  239.  
  240.  
  241.  
  242.  
  243. The disassemble command is entered as:
  244.  
  245.  
  246.         Ustart,end
  247.  
  248.  
  249. If the second parameter is absent the display will  continue  until  ESCape  is
  250. entered.  The program will display  15  lines  of  code,  and  then  pause  for
  251. keyboard input before continuing.  You may return to the main  menu  by  typing
  252. ESCape.
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                              X Emulation Monitor
  261.  
  262.  
  263.  
  264. The emulation monitor allows the processor simulation to execute  the  program.
  265. The monitor begins by asking for the execution address.  This  is  the  address
  266. for which simulation will begin.  You may respond with any valid expression.
  267.  
  268.  
  269.  
  270. Next the monitor  requests  a  string  of  breakpoint  addresses.    Up  to  10
  271. breakpoint addresses can be inserted in the program.  The simulator  will  will
  272. check the program counter against this list before executing every instruction.
  273. If a match is found the simulator will enter the single step mode  and  display
  274. the instruction, and register values.  If you wish to single step  the  program
  275. from the starting value you may type return as the response to  the  breakpoint
  276. query.  Each breakpoint can be assigned a pass counter, the number of times the
  277. breakpoint must be reached before the break will be effected.  The pass counter
  278. is assigned to a breakpoint by enclosing the pass count  in  parentheses  after
  279. the breakpoint address.  Thus in response to the breakpoint query you entry of:
  280.  
  281.  
  282. 100,200,300
  283.  
  284.  
  285. will impose first pass breakpoints at locations 100H,200H, and 300H.    Suppose
  286. you wish to allow the instruction at 200H to  be  executed,  say,  three  times
  287. before the break is imposed.  Your response in this case would be:
  288.  
  289.  
  290. 100,200(3),300
  291.  
  292.  
  293. After the pass count is reached at 200H the break is imposed and the breakpoint
  294. is thereafter imposed at every instance the program reaches this location.
  295.  
  296.  
  297.  
  298. Next the monitor requests a string of trap values.  These  are  16  bit  values
  299.  
  300.                               -5-
  301.  
  302.  
  303.  
  304.  
  305. which are to be tested against every instruction containing a 16 bit reference.
  306. If an instruction is found to contain a trap reference the simulator will enter
  307. the single step mode as if a breakpoint were reached.
  308.  
  309.  
  310.  
  311. During the single step mode it is important to note that two  instructions  are
  312. displayed.  The instruction just executed,  and  the  next  instruction  to  be
  313. executed pointed to by >.    The  status  of  the  flags  and  registers  is  a
  314. consequence of the instruction(s) executed and not that highlighted by >.
  315.  
  316.  
  317.  
  318. The program will run from the starting point without  display  until  either  a
  319. breakpoint or trap is reached, or until you type either ESCape,M,L,N,S,R,P,  or
  320. G. ESCape aborts the simulator and returns to the main menu. While the  program
  321. is free running typing L will cause the register display  to  be  presented  at
  322. each instruction, typing N will suppress the register display.  Typing  S  will
  323. force the single step mode, and typing G will resume  the  free  running  mode.
  324. Typing P, followed by a hex value, allows you to force the program  to  execute
  325. at the PC corresponding to the new value.  Typing R imposes a breakpoint at the
  326. next PC value.  This selection is most useful in the single step mode to  allow
  327. the emulator to skip over a subroutine CALL.  The R command replaces  the  last
  328. breakpoint in  your  breakpoint  list  with  the  address  of  the  instruction
  329. following the CALL, the single step and list flags are reset,  and  control  is
  330. passed to the emulator allowing the  program  to  free  run  until  the  return
  331. address is reached. Typing #nnn, where nnn is a valid expression,  remember  it
  332. is default hex, allows the emulator to run the next nnn steps, with display  on
  333. but operator intervention turned off.   Typing  M  enters  the  emulation  menu
  334. program.
  335.  
  336.  
  337.  
  338.  
  339. The emulation menu presents a list of options in the manner of the  main  menu.
  340. The options available from the emulation menu include many of  those  from  the
  341. main menu, and their manner of selection is identical.  You may  neither  enter
  342. the emulation monitor nor load a program from the emulation menu.    There  are
  343. additional selections from the emulation menu which pertain to the execution of
  344. the program.
  345.  
  346.  
  347.  
  348.  
  349.                           A Show All Register Space
  350.  
  351.  
  352. The single step emulation display does not  provide  for  the  display  of  the
  353. entire register bank for some processors.  This command allows you to view  all
  354. the registers.
  355.  
  356.  
  357.  
  358.  
  359.                              B Reset Breakpoints
  360.  
  361.  
  362.                               -6-
  363.  
  364.  
  365.  
  366.  
  367.  
  368. This option allows  you  to  re-define  the  breakpoint  list.    All  previous
  369. breakpoints are forgotten.
  370.  
  371.  
  372.  
  373.                      D Display Memory (as in main menu)
  374.  
  375.  
  376.  
  377.  
  378.                       E Enter Memory (as in main menu)
  379.  
  380.  
  381.  
  382.  
  383.                        F Fill Memory (as in main menu)
  384.  
  385.  
  386.  
  387.  
  388.                              G Quit Single Step
  389.  
  390.  
  391. This command resets the single step flag.  The program will execute in the free
  392. running mode when the menu is abandoned.  The free running mode  will  continue
  393. until a break point is reached or until control is gained from the keyboard.
  394.  
  395.  
  396.  
  397.                                H Trace History
  398.  
  399.  
  400. The emulator maintains a buffer of the last 16 instructions executed.  You  may
  401. examine this trace history by the H command.
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.                        M Move Memory (as in main menu)
  409.  
  410.  
  411.  
  412.  
  413.                         P Set PC for next instruction
  414.  
  415.  
  416. You may force the emulator to resume execution at a new address.   The  pending
  417. instruction before forcing the new PC value is not executed.
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.                               -7-
  425.  
  426.  
  427.  
  428.  
  429.                                  Q Quit Menu
  430.  
  431.  
  432. Return to the emulator.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.                                R Set Registers
  439.  
  440.  
  441. You are prompted for the manner in which you may alter the current contents  of
  442. the registers and flags.
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.                       S Search Memory (as in main menu)
  450.  
  451.  
  452.  
  453.  
  454.                                 T Reset Traps
  455.  
  456.  
  457. This option allows you to re-define the trap values.  As  with  the  breakpoint
  458. redefinition, all previous traps are forgotten.
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.                    U Disassemble Memory (as in main menu)
  466.  
  467.  
  468.  
  469.  
  470.                          V Display Processor Status
  471.  
  472.  
  473. You may obtain a view of the current processor status by selecting the  V  item
  474. from the emulation menu.  Remember that when you Quit the menu you will execute
  475. the next instruction of your program before you can get a chance to examine the
  476. processor.  The V option allows you  to  examine  the  state  before  the  next
  477. instruction.  If you are in the single step mode, as  opposed  to  interrupting
  478. the processor by typing M, the V display  will  duplicate  what  you  saw  just
  479. before entering the emulation menu.
  480.  
  481.  
  482.  
  483.  
  484.                                 W Set Window
  485.  
  486.                               -8-
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493. The processor status display allows for the definition of a memory window of 16
  494. bytes length.  This window is shown along with the register and timing display.
  495. You may position this window within the workspace area by the W command:
  496.  
  497.  
  498.         Wvalue
  499.  
  500.  
  501. The window will retain this value.
  502.  
  503.  
  504.  
  505.  
  506.                              Z Zero Trip Cycles
  507.  
  508.  
  509. The emulator maintains two counters which accumulate the  number  of  processor
  510. cycles during program execution.  These counters are set to zero  at  entry  to
  511. the emulation monitor.  One of these counters can be set to zero at any time by
  512. the emulation monitor.
  513.  
  514.  
  515.  
  516.  
  517.  
  518.                             PROGRAM INPUT/OUTPUT
  519.  
  520.  
  521.  
  522. If the processor supports i/o instructions the simulator will call routines  to
  523. gain input from the keyboard, or display output on the console.  Program output
  524. requires a key press from the user before execution continues.  If the  program
  525. is free running at this time, typing ESCape will enter the  single  step  mode.
  526. To enter the single step mode for a free running program  locked  in  an  input
  527. loop, you must type an invalid hex input, say carriage return, and receive  the
  528. invalid prompt message.  At this point you may type ESCape to enter the  single
  529. step mode.    Emulation Speed   
  530. As a rough indication of the relative speed of the emulation program, a
  531. simulation of the 65Cxx series on a 5MHz 8086 yielded approximately 1000
  532. simulated processor cycles per second.  This is between one and two thousand
  533. times slower than the real execution speed.
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.                               -9-
  549.  
  550.  
  551.